{template header}

    {template sidebar}

    <!-- artile begin -->
    <div class="article">

        {template title}

    <!--{if $a == 'index'}-->

        <table cellpadding="1" cellspacing="1" width="100%" border="0">

            <tr>
                <th class="td2">标题</th>
                <th width="15%">选项</th>
            </tr>

        <!--{if $this->result}-->
            <!--{loop $this->result $val}-->

            <tr>
                </td>
                <td class="td2">
                    <div class="{echo 'icon' . $val['node']}">{$val["title"]}</div>
                </td>
                <td class="operate">
                    <a title="编辑页面" href="{$this->url($c, 'edit', array('id' => $val['id']))}">编辑</a>
                    <a title="删除页面" class="del" href="{$this->url($c, 'del', array('id' => $val['id']))}">删除</a>
                </td>
            </tr>
            <!--{/loop}-->
        <!--{else}-->
            <tr>
                <td colspan="2">没有页面!</td>
            </tr>
        <!--{/if}-->

            <tr>
                <th colspan="2" class="td6">
                    <a href="{$this->url($c, 'add')}" class="button green">添加页面</a>
                </th>
            </tr>

        </table>
    <!--{/if}-->

    <!--{if $a == 'add' || $a == 'edit' }-->

        <form method="post" action="{$this->url( 'archive', 'save', array('id' => $result['id'], 'type' => 'page'))}">
            <input type="hidden" name="archive[model]" value="{$c}" />
            <input type="hidden" name="archive[uid]" value="{$this->admin['uid']}" />
            <table cellpadding="1" cellspacing="1" width="100%" border="0">
                <tr>
                    <th colspan="2" class="td2"><b>{$a == 'add' ? '添加页面' : ($a == 'edit' ? '编辑页面' : '')}</b></th>
                </tr>
                <tr>
                    <td class="td1" width="25%">页面标题：</td>
                    <td class="td2">
                        <input type="text" size="50" name="archive[title]" placeholder="请输入页面标题" class="required" value="{$a == 'edit' ? $result['title'] : ''}" />
                    </td>
                </tr>

                <tr>
                    <td class="td1">页面分类：</td>
                    <td class="td2">
                        <select name="archive[sid]">
                            <option value="0">无父级</option>
                            <!--{loop $this->page_result $tree}-->
                            {eval $select = $tree['id'] == (isset($result['sid']) ? $result['sid'] : 0) ? ' selected' : ''}
                            <!--{if $tree['id'] != $result['id']}-->
                            <option value="{$tree['id']}"{$select}>{$tree['treeTitle']}</option>
                            <!--{/if}-->
                            <!--{/loop}-->
                        </select>
                    </td>
                </tr>

                <tr>
                    <td class="td1">页面内容：</td>
                    <td class="td2">
                        <textarea name="archive[content]" id="message" style="width:100%;height:230px;">{$a == 'edit' ? htmlspecialchars_decode($result['content']) : ''}</textarea>
                        <script src="{$this->setting['weburl']}/content/editor/editor.js"></script>
                        <script>showEdit1(1);</script>
                        <p style="padding-top: 10px;">{template upload}</p>
                        <p style="padding-top: 10px;">可用扩展名: {$this->getType()} 单个文件大小: {$this->getSize()}</p>
                    </td>
                </tr>

                <tr class="options">
                    <td class="td1">发布时间：</td>
                    <td class="td2">
                        <input type="text" size="25" id="dateline" name="archive[dateline]" value="{$a == 'edit' ? date($this->setting['timeformat'], $result['dateline']) : date($this->setting['timeformat'], time())}" readonly />
                        <!--{if $a == 'edit'}-->
                        <a href="" id="update_time">插入当前时间</a>
                        <script type="text/javascript">
                            $("#update_time").click(function () {
                                $("#dateline").val("{echo date($this->setting['timeformat'], time())}");
                                return false;
                            });
                        </script>
                        <!--{/if}-->
                    </td>
                </tr>

                <tr class="options">
                    <td class="td1">页面别名：</td>
                    <td class="td2">
                        <input type="text" name="archive[alias]" size="25" value="{$a == 'edit' ? $result['alias'] : ''}" />
                    </td>
                </tr>

                <tr class="options">
                    <td class="td1">页面标签 ：</td>
                    <td class="td2">
                        <input type="text" name="tag[tagname]" size="40" value="{$a == 'edit' ? $result['tagname'] : ''}" />
                        <span>标签之间用(,)号隔开。最多6个标签</span>
                    </td>
                </tr>

                <tr>
                    <th colspan="2" class="td4">
                        <a class="button save" title="保存页面" href="{$this->url($c)}">保 存</a>
                        <input type="checkbox" class="checkbox showOption" />高级
                    </th>
                </tr>
            </table>
        </form>
    <!--{/if}-->
    </div>
    <!-- artile end -->
{template footer}